﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using static DXApplicationTangche.UC.门店下单.form.Frm订单一览;
using DXApplicationTangche.UC.订单.service;

namespace DXApplicationTangche.UC.订单
{
    public partial class Form订单 : DevExpress.XtraEditors.XtraForm
    {
        private String styleId = "";
        private String orderId = "";
        private String shopId = "18";
        private String pageStart;
        private String pageSize;
        private Enum订单类别 enum订单类别 = Enum订单类别.销售订单;
        public Form订单()
        {
            InitializeComponent();
            this.xtraUserControl分页.williamPagerEvent += this.refreshGrid;
            this.judgeShop();
            this.refreshGrid(1);
        }
        private void refreshGrid(int curPage)
        {
            //从DTO获取数据，绑定数据
            //API只要一行，原子性
            this.gridControl1.DataSource = new 订单Service(this.shopId, (curPage - 1).ToString(), "100").orderDTOs;
            this.bandedGridView1.ExpandAllGroups();
        }

        private void judgeShop()
        {
            switch (this.enum订单类别)
            {
                case Enum订单类别.销售订单:
                    this.shopId = "18";
                    break;
                case Enum订单类别.样品订单:
                    this.shopId = "48";
                    break;
                case Enum订单类别.套号订单:
                    this.shopId = "50";
                    break;
                case Enum订单类别.坚山订单:
                    this.shopId = "46";
                    break;
                case Enum订单类别.坚山美国订单:
                    this.shopId = "49";
                    break;
                case Enum订单类别.Luna店铺订单:
                    this.shopId = "51";
                    break;
                case Enum订单类别.坚山上海订单:
                    this.shopId = "52";
                    break;
            }
        }
    }
}